<template>
  <view class="m-5 flex flex-col space-y-3">
    id: 1,
    quantity: 1,
    subtotal: 5,
    <u-button @click="handleQrCode">生成二维码</u-button>
  </view>
</template>

<script setup lang="ts">

import api from "@/api";

const handleQrCode = () => {
  const productList = [
    {
      id: 1,
      quantity: 1,
      subtotal: 0.01,
    }
  ]

  api.pay.nativePay({
    productList: JSON.stringify(productList),
    total: 0.01,
    userId: 1,
  }).then((res:any) => {
    if(res.data.code===0){
      console.log(res)
    }
  })
}


</script>

<style scoped>

</style>